<template>
  <div>
    <!-- 访客记录-详情 -->
    <public-modal
      width="1000px"
      :footer="false"
      title="企业回执详情"
      modalStyle="detailModal"
      :publicVisible="publicVisible"
      :zIndex="9999"
      cancelContext="拒绝"
      confirmContext="通过"
      @handleOk="handleOk"
      @cancel="cancel"
    >
      <div slot="content">
        <div class="common-title">
          <div class="icon"></div>
          <div class="content">回执详情</div>
        </div>

        <div class="content-wrapper">
          <div class="flex">
            <div class="info-wrap f1">
              <div class="label common-lable">单位名称</div>
              <a-tooltip
                placement="topLeft"
                :getPopupContainer="
                  (triggerNode) => {
                    return triggerNode.parentNode || document.body
                  }
                "
              >
                <template slot="title">
                  <span>{{ details.companyMessageName || '暂无' }} </span>
                </template>
                <div class="value common-value">{{ details.companyMessageName || '暂无' }}</div>
              </a-tooltip>
            </div>
            <div class="info-wrap f1">
              <div class="label common-lable">所属行业</div>
              <div class="value common-value">{{ details.industryInformationName || '暂无' }}</div>
            </div>
          </div>
          <div class="flex">
            <div class="info-wrap f1">
              <div class="label common-lable">回执提交时间</div>
              <div class="value common-value">{{ details.receiptTime || '暂无' }}</div>
            </div>
            <div class="info-wrap f1">
              <div class="label common-lable">回执是否逾期</div>
              <div class="value common-value">{{ details.isReceiptOverdue == 0 ? '否' : '是' || '暂无' }}</div>
            </div>
          </div>
          <div class="flex" v-if="details.isFined == 1">
            <div class="info-wrap f1">
              <div class="label common-lable">罚款金额</div>
              <div class="value common-value">
                {{ details.finedMoney || '暂无' }}元-{{ details.isFined == 0 ? '未缴纳' : '已缴纳' }}
              </div>
            </div>
          </div>
          <div class="flex">
            <div class="info-wrap f1">
              <div class="label common-lable">处理文字</div>
              <div class="value common-value">{{ details.receiptContent || '暂无' }}</div>
            </div>
          </div>
          <div class="flex" v-if="details.receiptImageInfoList && details.receiptImageInfoList.length > 0">
            <div class="info-wrap f1">
              <div class="label common-lable flex justify-center align-center" style="height: 100%">处理图片</div>
              <div class="img-wrap flex" style="padding: 10px 16px">
                <img
                  v-for="(item, index) in details.receiptImageInfoList"
                  :key="index"
                  alt=""
                  class="cursor cusImg"
                  :id="'idimg' + index"
                  @click="werImg(index)"
                  :src="`${imgPrefix + item.path}`"
                  :data-original="`${imgPrefix + item.path}`"
                />
              </div>
            </div>
          </div>
        </div>
      </div>
      <div slot="footer"></div>
    </public-modal>
  </div>
</template>
<script>
import Viewer from 'viewerjs'
import 'viewerjs/dist/viewer.css'
import publicModal from '@/components/publicModal'
import { comMethods } from '@/mixins/comMethods'
export default {
  name: 'detailModal',
  components: { publicModal },
  mixins: [comMethods],
  data() {
    return {
      details: {},
      publicVisible: false,
    }
  },
  mounted() {},
  methods: {
    show(records) {
      this.details = records
      this.publicVisible = true
    },
    handleOk() {
      this.publicVisible = false
    },
    cancel() {
      this.publicVisible = false
    },
    werImg(i) {
      let id = 'idimg' + i
      const ViewerDom = document.getElementById(id)
      const viewer = new Viewer(ViewerDom, {
        toolbar: false,
        button: false,
        navbar: false,
        title: false,
        zIndex: '9999',
        url: 'data-original',
      })
    },
  },
}
</script>
<style scoped lang="less">
/deep/ .modalCotent {
  padding: 20px 40px;
  border-radius: 0 0 4px 4px;
}
/deep/ .modalFooter {
  height: 0 !important;
}

.cusImg {
  width: 233px;
  height: 150px;
  object-fit: cover;
  &:nth-child(2) {
    margin: 0 16px;
  }
}
</style>
